package com.xm.servlet.background.administrator;

import com.google.gson.Gson;
import com.xm.service.background.AdministratorService;
import lombok.SneakyThrows;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 账号Servlet
 *
 * @author 陈盼
 * @date 2024-01-11 下午 02:50
 */
@WebServlet("/background/get/administrator")
public class GetAdministratorServlet extends HttpServlet {

    private final AdministratorService service = new AdministratorService();

    @SneakyThrows(Exception.class)
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html;charset=utf-8");
        resp.getWriter().print(new Gson().toJson(service.getId()));
    }

}
